/*
 * InventoryFrameBackend.java
 * Team qq 2011
 */
package com.google.code.timetrail.presenter;

import java.util.List;

import com.google.code.timetrail.backend.Control;
import com.google.code.timetrail.backend.Person;

/**
 * This is the backend for the inventory backend
 * 
 * @author Utkarsh
 * @version 1.1
 */
public class InventoryFrameBackend {
	/**
	 * The control for the game
	 */
	private final Control gameControl;

	/**
	 * The list of people as players
	 */
	private final List<Person> players;

	/**
	 * Value 2
	 */
	private static final int VALUE_TWO = 2;
	
	/**
	 * This is the constructor for the inventory frame backend
	 * 
	 * @param gameControl
	 *            the control for the game
	 */
	public InventoryFrameBackend(Control gameControl) {
		this.gameControl = gameControl;
		players = this.gameControl.getMembers();
	}

	/**
	 * Returns the title
	 * 
	 * @return the title
	 */
	public String getTitle() {
		return "Inventory";
	}

	/**
	 * Return the money label
	 * 
	 * @return the money label
	 */
	public String getMoneyLabel() {
		return "Money";
	}

	/**
	 * Returns the hull parts label
	 * 
	 * @return the hull parts label
	 */
	public String getHullPartsLabel() {
		return "Hull Parts";
	}

	/**
	 * Returns the time bullets label
	 * 
	 * @return the time bullets label
	 */
	public String getTimeBulletsLabel() {
		return "Time Bullets";
	}

	/**
	 * Returns the time suits label
	 * 
	 * @return the time suits label
	 */
	public String getTimeSuitsLabel() {
		return "Time Suits";
	}

	/**
	 * Returns the engines label
	 * 
	 * @return the engines label
	 */
	public String getEnginesLabel() {
		return "Engines";
	}

	/**
	 * Returns the Flux Capacitor label
	 * 
	 * @return the flux capacitor label
	 */
	public String getFCapacitorLabel() {
		return "Flux Capacitors";
	}

	/**
	 * Returns the food label
	 * 
	 * @return the food label
	 */
	public String getFoodLabel() {
		return "Food";
	}

	/**
	 * Returns the fuel cell label
	 * 
	 * @return the fuel cell label
	 */
	public String getFuelCellsLabel() {
		return "Fuel Cells";
	}

	/**
	 * Returns the money amount
	 * 
	 * @return the money amount
	 */
	public String getMoneyAmount() {
		return Integer.toString(gameControl.getInv().getMoney()
				.getCurrentAmount());
	}

	/**
	 * Returns the hull parts amount
	 * 
	 * @return the hull parts amount
	 */
	public String getHullPartsAmount() {
		return Integer.toString(gameControl.getInv().getHullParts()
				.getCurrentAmount());
	}

	/**
	 * Returns the time bullets amount
	 * 
	 * @return the time bullets amount
	 */
	public String getTimeBulletsAmount() {
		return Integer.toString(gameControl.getInv().getTimeBulletBills()
				.getCurrentAmount());
	}

	/**
	 * Returns the time suits amount
	 * 
	 * @return the time suits amount
	 */
	public String getTimeSuitsAmount() {
		return Integer.toString(gameControl.getInv().getTimeSuits()
				.getCurrentAmount());
	}

	/**
	 * Returns the engines amount
	 * 
	 * @return the engines amount
	 */
	public String getEnginesAmount() {
		return Integer.toString(gameControl.getInv().getEngines()
				.getCurrentAmount());
	}

	/**
	 * Returns the Flux capacitor amount
	 * 
	 * @return the flux capacitor amount
	 */
	public String getFCapacitorAmount() {
		return Integer.toString(gameControl.getInv().getFCapacitors()
				.getCurrentAmount());
	}

	/**
	 * Returns the food amount
	 * 
	 * @return the food amount
	 */
	public String getFoodAmount() {
		return Integer.toString(gameControl.getInv().getFood()
				.getCurrentAmount());
	}

	/**
	 * Returns the fuel cells amount
	 * 
	 * @return the fuel cells amount
	 */
	public String getFuelCellsAmount() {
		return Integer.toString(gameControl.getInv().getFuelCells()
				.getCurrentAmount());
	}

	/**
	 * Returns the player
	 * 
	 * @param playerNumber
	 *            which player
	 * @return the player
	 */
	public String getPlayer(int playerNumber) {
		if (players.size() >= playerNumber) {
			return players.get(playerNumber - 1).toString();
		} else {
			return "";
		}
	}

	/**
	 * Returns the player status
	 * 
	 * @param playerNumber
	 *            which player
	 * @return the player status
	 */
	public String getPlayerStatus(int playerNumber) {
		if (players.size() >= playerNumber) {
			return players.get(playerNumber - 1).getStatus();
		} else {
			return "";
		}
	}

	/**
	 * Returns the first player
	 * 
	 * @return the first player
	 */
	public String getFirstPlayer() {
		return players.get(0).toString();
	}

	/**
	 * Returns the first player status
	 * 
	 * @return the first player statis
	 */
	public String getFirstPlayerStatus() {
		return players.get(0).getStatus();
	}

	/**
	 * Returns the second player
	 * 
	 * @return the second player
	 */
	public String getSecondPlayer() {
		if (players.size() >= VALUE_TWO) {
			return players.get(1).toString();
		} else {
			return players.get(1).getStatus();
		}
	}

	/**
	 * Returns the second player status
	 * 
	 * @return the second player status
	 */
	public String getSecondPlayerStatus() {
		return null;
	}

	/**
	 * Returns the third player 
	 * 
	 * @return the third player 
	 */
	public String getThirdPlayer() {
		return null;
	}

	/**
	 * Returns the third player status
	 * 
	 * @return the third player status
	 */
	public String getThirdPlayerStatus() {
		return null;
	}

	/**
	 * Returns the fourth player 
	 * 
	 * @return the fourth player 
	 */
	public String getFourthPlayer() {
		return null;
	}

	/**
	 * Returns the fourth player status
	 * 
	 * @return the fourth player status
	 */
	public String getFourthPlayerStatus() {
		return null;
	}

	/**
	 * Returns the fifth player 
	 * 
	 * @return the fifth player 
	 */
	public String getFifthPlayer() {
		return null;
	}

	/**
	 * Returns the fifth player status
	 * 
	 * @return the fifth player status
	 */
	public String getFifthPlayerStatus() {
		return null;
	}

	/**
	 * Returns the back button text
	 * @return the back button text
	 */
	public String getBackButtonText() {
		return "<< Back";
	}

	/**
	 * Returns the save button text
	 * @return the save button text
	 */
	public String getSaveButtonText() {
		return "Save";
	}

	/**
	 * Returns the skills button text
	 * @return the skills button text
	 */
	public String getSkillsButtonText() {
		return "Skills";
	}

	/**
	 * The name of the class
	 * 
	 * @return the name of the class
	 */
	@Override
	public String toString() {
		return "InventoryFrameBackend";
	}
}
